home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / M-Md / Mask It! 1.0.cpt / Mask It! 1.0 / cards.xml < prev    next >
Text File  |  1992-07-07  |  10KB  |  132 lines

  1. card_2916.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>2916</id>
  6.     <filler1>0</filler1>
  7.     <cantDelete> <false /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <owner>2577</owner>
  11.     <link rel="stylesheet" type="text/css" href="stylesheet_3251.css" />
  12.     <part>
  13.         <id>10</id>
  14.         <type>field</type>
  15.         <visible> <false /> </visible>
  16.         <dontWrap> <false /> </dontWrap>
  17.         <dontSearch> <true /> </dontSearch>
  18.         <sharedText> <false /> </sharedText>
  19.         <fixedLineHeight> <true /> </fixedLineHeight>
  20.         <autoTab> <false /> </autoTab>
  21.         <lockText> <true /> </lockText>
  22.         <rect>
  23.             <left>22</left>
  24.             <top>49</top>
  25.             <right>329</right>
  26.             <bottom>193</bottom>
  27.         </rect>
  28.         <style>shadow</style>
  29.         <autoSelect> <false /> </autoSelect>
  30.         <showLines> <false /> </showLines>
  31.         <wideMargins> <true /> </wideMargins>
  32.         <multipleLines> <false /> </multipleLines>
  33.         <reservedFamily> 0 </reservedFamily>
  34.         <titleWidth>0</titleWidth>
  35.         <icon>0</icon>
  36.         <textAlign>left</textAlign>
  37.         <font>Geneva</font>
  38.         <textSize>9</textSize>
  39.         <textStyle>plain</textStyle>
  40.         <textHeight>12</textHeight>
  41.         <name>Credits</name>
  42.         <script>on mouseUphide mehide cd btn "Credits ICON"pass mouseUpend mouseUp</script>
  43.     </part>
  44.     <part>
  45.         <id>9</id>
  46.         <type>button</type>
  47.         <visible> <false /> </visible>
  48.         <reserved5> 0 </reserved5>
  49.         <reserved4> 0 </reserved4>
  50.         <reserved3> 0 </reserved3>
  51.         <reserved2> 0 </reserved2>
  52.         <reserved1> 0 </reserved1>
  53.         <enabled> <true /> </enabled>
  54.         <rect>
  55.             <left>207</left>
  56.             <top>131</top>
  57.             <right>255</right>
  58.             <bottom>172</bottom>
  59.         </rect>
  60.         <style>transparent</style>
  61.         <showName> <false /> </showName>
  62.         <highlight> <false /> </highlight>
  63.         <autoHighlight> <false /> </autoHighlight>
  64.         <sharedHighlight> <true /> </sharedHighlight>
  65.         <family>0</family>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>6002</icon>
  68.         <textAlign>center</textAlign>
  69.         <font>Chicago</font>
  70.         <textSize>12</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <name>Credits ICON</name>
  73.         <script>on mouseUphide mehide cd fld "Credits"pass mouseUpend mouseUp</script>
  74.     </part>
  75.     <part>
  76.         <id>11</id>
  77.         <type>field</type>
  78.         <visible> <false /> </visible>
  79.         <dontWrap> <false /> </dontWrap>
  80.         <dontSearch> <true /> </dontSearch>
  81.         <sharedText> <false /> </sharedText>
  82.         <fixedLineHeight> <false /> </fixedLineHeight>
  83.         <autoTab> <false /> </autoTab>
  84.         <lockText> <true /> </lockText>
  85.         <rect>
  86.             <left>19</left>
  87.             <top>48</top>
  88.             <right>362</right>
  89.             <bottom>222</bottom>
  90.         </rect>
  91.         <style>shadow</style>
  92.         <autoSelect> <false /> </autoSelect>
  93.         <showLines> <false /> </showLines>
  94.         <wideMargins> <true /> </wideMargins>
  95.         <multipleLines> <false /> </multipleLines>
  96.         <reservedFamily> 0 </reservedFamily>
  97.         <titleWidth>0</titleWidth>
  98.         <icon>0</icon>
  99.         <textAlign>left</textAlign>
  100.         <font>Geneva</font>
  101.         <textSize>9</textSize>
  102.         <textStyle>plain</textStyle>
  103.         <textHeight>12</textHeight>
  104.         <name>Help</name>
  105.         <script>on mouseUphide mepass mouseUpend mouseUp</script>
  106.     </part>
  107.     <content>
  108.         <layer>background</layer>
  109.         <id>1</id>
  110.         <text>81,72,110,95</text>
  111.     </content>
  112.     <content>
  113.         <layer>card</layer>
  114.         <id>10</id>
  115.         <text><span class="style2"> This stack created by Brian Blood. If you have any questions, comments, suggestions, and/or bug reports, please contact me at any of the following addresses.AppleLink: Maverick                  America Online: Maveric9CompuServe: 72540,1771        InterNet: Maveric9@aol.comSnail Mail:6000 Ohio Dr. #3014                                             </span><span class="style3">Howdy!</span><span class="style2">Plano, TX 75093This stack ¬©1992 All Rights Reserved, by Brian Blood.</span></text>
  116.     </content>
  117.     <content>
  118.         <layer>card</layer>
  119.         <id>11</id>
  120.         <text><span class="style6">ask It!</span><span class="style4">What it is:</span><span class="style2">  This stack is a tool for graying out painting in HyperCard. This would be used, for example, to simulate a disabled button in HyperCard.</span><span class="style4">How it works:</span><span class="style2">  Simply place/create the art you want masked onto the card paint layer and then click "Mask It!". The cursor will turn to a cross and you will then define the rectangle to be masked. The image will then be masked. Use the "Make a Copy of:" popup to select what will be placed into the clipboard after the masking operation is complete.</span><span class="style4">What else:</span><span class="style2">  If you need more room then you can resize the card window by clicking on the grow box button at the bottom right-hand corner of the window.</span></text>
  121.     </content>
  122.     <content>
  123.         <layer>background</layer>
  124.         <id>12</id>
  125.         <text>Nothing</text>
  126.     </content>
  127.     <name></name>
  128.     <script>on doMask preWarmif preWarm is true then exit doMaskset cursor to watchlock screen-- do check for card layer artworkchoose select tooldoMenu "Select"get the toolchoose browse toolif it is not "Lasso Tool" thenanswer "There is no artwork on the card layer." -- ‚àÜexit doMaskelse unlock screen-- setting cursor and getting the rectput "Select the rect to be masked by click-dragging a rectangle."put Ants() into theRectput theRect into bg fld "Last Rect"set cursor to watchlock screenput item 1 of theRect into theLeftput item 2 of theRect into theTopput item 3 of theRect into theRightput item 4 of theRect into theBottom-- putting a copy of the graphics rect into the clipboardput bg fld "Copy What" into copyWhatif copyWhat is "Original Art" thenchoose select tooldrag from (item 1 to 2 of theRect) to (item 3 to 4 of theRect)doMenu "Copy Picture"end if-- setting up the masking environmentchoose brush toolput the brush into SvBrushput the pattern into SvPatternset the brush to 28set the pattern to 1-- when then vert coordinate is even & the horiz coordinate is odd the pixel is black-- when then vert coordinate is odd & the horiz coordinate is even the pixel is whiteput even(theLeft) into theLeftEvenrepeat with vertCd=theTop to theBottomset cursor to busyput theLeft into horizCdput even(vertCd) into vertEvenif (vertEven and theLeftEven) or (not vertEven and not theLeftEven) then add 1 to horizCdrepeat until horizCd>theRightif thePixel(horizCd, vertCd) is "black" then click at horizCd,vertCdadd 2 to horizCdend repeatunlock screenlock screenend repeat-- getting rid of the opaque white spacechoose select tooldrag from (item 1 to 2 of theRect) to (item 3 to 4 of theRect) with optionKeyif copyWhat is "Masked Art" thenchoose select tooldrag from (item 1 to 2 of theRect) to (item 3 to 4 of theRect)doMenu "Copy Picture"end if-- resetting the propertiesset the brush to SvBrushset the pattern to SvPatternchoose browse toolput "Masking complete."beepend doMaskfunction odd theNumreturn (theNum/2) ‚↠trunc(theNum/2)end oddfunction even theNumreturn (theNum/2) = trunc(theNum/2)end even-- if I go to a XCMD, use patBic for the transfer mode.--------------------------------------****** SPLIT BAR HORIZONTAL ****--------------------------------------global theMode:I,pixThick:I, minY:I,maxY:I,lastY:I,startX:I,endX:Ifunction splitBarH  minHeight, maxHeight, cursorV, leftX, rightX, thePenMode,thickness,penPatternput cursorV+0 into lastYput minHeight+0 into minYput maxHeight+0 into maxYput leftX+0 into startXput rightX+0 into endXput 0+0 into theModeif thePenMode is empty then put 0+0 into thePenModeadd thePenMode to theModeput 0+0 into pixThickif thickness is empty then put 1+0 into thicknessadd thickness div 1 to pixThickif penPattern is empty then put "gray" into penPattern----------------------------------- first set the correct patternif penPattern = "Black" thenpenPat blackend ifif penPattern = "gray" thenpenPat grayend ifif penPattern = "ltgray" thenpenPat ltgrayend ifif penPattern = "dkgray" thenpenPat dkgrayend ifif penPattern = "white" thenpenPat whiteend if-----penMode theModepenSize 1,pixThick----------------------------------- draw the initial line the user sees.moveTo startX,lastYlineTo endX,lastYput 0+0 into y  -- intiliaze this to 0if pixThick > 2 then put pixThick div 2 into locAdjuster------------------------------------------------------repeat--  use toolbox call which gets "the mouseLoc".-- The "mouseVH" container is a 32 bit longInteger which contains the horizontal-- coordinate in the "LoWord" and the vertical coordinate in the "HiWord".GetMouse mouseVHsubtract y from yadd HiWord(mouseVH) - locAdjuster to y --click offset-- clip "the mouseLoc" to the upper and lower limits.if y < minY thensubtract y from yadd minY to yend ifif y > maxY thensubtract y from yadd maxY to yend if-- If the new position is different than the last one, then draw a new line,-- otherwise, don't do anything thereby avoiding a flickering of the line-- as it would be erased and redrawn at the same position constantly.if  y <> lastY then-- "Erase" the previous line by drawing it again, with our two statements.lineTo startX,lastY-- put the new mouseH into lastYsubtract lastY from lastYadd y to lastY-- "Draw" the new line with our two statements.moveTo startX,lastYlineTo endX,lastYend if   -- we drew a new line.-- Use the "Button()" toolbox call to see if the mouse button is up. If it is,-- exit the repeat loop, otherwise get "the mouseLoc" for the next repeat.if not button() then exit repeatend repeat---------------------------------- Done. Erase the current line by drawing it again.lineTo startX,lastY----------------------------------- Finally, return the new Y, which could be the same as before or differentreturn lastYend splitBarH-- Note that the penState should be fetched and save before invoking this eternal and restored afterwords.  Since this is not implemented this XFCN is incomplete</script>
  129. </card>
  130.  
  131.  
  132.